/**
 * My typedef:s so I don't have to type unsigned all the time.
 */

#ifndef __MY_BIT
#define __MY_BIT

#define SET_ALL  |= 0xFF; 
#define SET_BIT0 |= 0x01; 
#define SET_BIT1 |= 0x02;
#define SET_BIT2 |= 0x04;
#define SET_BIT3 |= 0x08;
#define SET_BIT4 |= 0x10;
#define SET_BIT5 |= 0x20;
#define SET_BIT6 |= 0x40;
#define SET_BIT7 |= 0x80;

#define CLEAR_ALL  &= 0x00;
#define CLEAR_BIT0 &= 0xFE;
#define CLEAR_BIT1 &= 0xFD;
#define CLEAR_BIT2 &= 0xFB;
#define CLEAR_BIT3 &= 0xF7;
#define CLEAR_BIT4 &= 0xEF;
#define CLEAR_BIT5 &= 0xDF;
#define CLEAR_BIT6 &= 0xBF;
#define CLEAR_BIT7 &= 0x7F;


//TO_VAR, FROM_VAR unsigned char
//BIT_NUM the bit to get 0..7
#define GET_BIT(TO_VAR, FROM_VAR, BIT_NUM)  {\
	TO_VAR=FROM_VAR;\
	TO_VAR>>=BIT_NUM;\
	TO_VAR&=0x01;\
}

#endif //__MY_TYPES
